<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
	<form action="?">
		<div class="tt">店铺搜索</div>
		<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
		<input type="hidden" name="file" value="<?php echo $file;?>"/>
		<input type="hidden" name="action" value="<?php echo $action;?>"/>
		<table cellpadding="2" cellspacing="1" class="tb">
			<tr>
				<td>&nbsp;
					<select name="kwType">
						<option value="shopname" <?php if($kwType == 'shopname') { ?> selected="selected" <?php } ?>>商户名称</option>
						<option value="username" <?php if($kwType == 'username') { ?> selected="selected" <?php } ?>>用户名</option>
					</select>
					<input type="text" size="30" name="kw" value="<?php echo $kw;?>" title="关键词"/>&nbsp;
					&nbsp;
					<input type="text" name="psize" value="<?php echo $pagesize;?>" size="2" class="t_c" title="条/页"/>
					&nbsp; 店铺类别
					<select name="storetype">
						<option value="all" <?php if($storetype == 'all') { ?> selected="selected" <?php } ?>>全部</option>
						<option value="mainstore" <?php if($storetype == 'mainstore') { ?> selected="selected" <?php } ?>>总店</option>
						<option value="branchstore" <?php if($storetype == 'branchstore') { ?> selected="selected" <?php } ?>>分店</option>
					</select>
					&nbsp; 时间排序
					<select name="orderType">
						<option value="itemidDesc" <?php if($orderType == 'itemidDesc') { ?> selected="selected" <?php } ?>>时间由近到远</option>
						<option value="itemidAsc" <?php if($orderType == 'itemidAsc') { ?> selected="selected" <?php } ?>>时间由远到近</option>
					</select>
					<input type="submit" value="搜 索" class="btn"/>&nbsp;
					<input type="button" value="重 置" class="btn" onclick="window.location='?moduleid=<?php echo $moduleid;?>&file=<?php echo $file;?>&action=<?php echo $action;?>';"/>
				</td>
			</tr>
		</table>
	</form>
	<form method="post">
		<div class="tt">店铺管理</div>
		<table cellpadding="2" cellspacing="1" class="tb">
			<tr>
				<th width="25"><input type="checkbox" onclick="checkall(this.form);"/></th>
				<th>商家用户名</th>
				<th>商店名称</th>
				<th>是否分店</th>
				<th>营业执照</th>
				<th>缩略图</th>
				<th>地区</th>
				<th>加入时间</th>
				<th>操作</th>
			</tr>
			<?php foreach ($lists as $k => $v) { ?>
				<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
					<td><input type="checkbox" name="itemid[]" value="<?php echo $v['itemid'];?>"/></td>
					<td><?php echo $v['username'];?></td>
					<td><?php echo $v['shopname'];?></td>
					<td><?php if ($v['mainstore']) { ?>总店 <?php } else { ?>分店<?php } ?></td>
					<td><?php if ($v['license_url']) { ?><img height="50" src="<?php echo $v['license_url'] ?>"><?php } else { ?>暂无图片<?php } ?></td>
					<td><?php if ($v['thumb']) { ?><img height="50" src="<?php echo $v['thumb'] ?>"><?php } else { ?>暂无图片<?php } ?></td>
					<td><?php echo Area::pos($v['areaid']);?></td>
					<td><?php echo date('m-d H:i', $v['addtime'])?></td>
					<td>
						<a href="?moduleid=2&file=business&action=view&itemid=<?php echo $v['itemid'];?>">查看</a>
						<a href="?moduleid=2&file=business&action=delete&itemid=<?php echo $v['itemid'];?>" onclick="confirm('确认删除?')">删除</a>
					</td>
				</tr>
			<?php }?>
		</table>
	</form>
	<div class="pages"><?php echo  $pn->render();?>
	<span>共<?php echo $pn->getRecords();?>条/<?php echo $pn->getPages();?>页&nbsp;
		<?php if ($pn->getPages()>1){;?>
		到第</span>
		<input type="text" name="page-num-input" size="2" id="xd_page_jump"/>
		<span>页</span>
		<button type="submit" onclick="xdChangeAndLocation('page', $('#xd_page_jump').val())">确定</button>
		<?php };?></div>
	<script type="text/javascript"><?php if ($unaudited) { ?>Menuon(1);<?php } elseif($refuse){ ?>Menuon(2);<?php } else { ?>Menuon(0);<?php } ?></script>
<?php include tpl('footer'); ?>